
Chapter 33. Using Web Service APIs

From the website:

  Killer Game Programming in Java
  http://fivedots.coe.psu.ac.th/~ad/jg

  Dr. Andrew Davison
  Dept. of Computer Engineering
  Prince of Songkla University
  Hat yai, Songkhla 90112, Thailand
  E-mail: ad@fivedots.coe.psu.ac.th


If you use this code, please mention my name, and include a link
to the website.

Thanks,
  Andrew

============================

An application which sends a book title to Yahoo's Shopping 
service, and gets back a PNG image of the book's cover. 
	- uses Yahoo's Product Search API

This version returns data in XML format.


This directory contains:

  * SearchYahoo.java
	- does the search 
        - you MUST MODIFY the APP_ID line
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	- use the key assigned to you by Yahoo (see "Getting a Key" below)

  * WebUtils.java
	- useful support methods 

  * NamespaceContextImpl.java
	- for XML namespace contexts (by Deepak Vohra)

There is 1 batch file:

  * UseProxy.bat
     - you MUST MODIFY its proxy settings to suit you
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

----------------------------
Getting a Key

Go to Yahoo! Shopping Web Services
  http://developer.yahoo.com/shopping/
  
Get an Application ID by pressing on the "Get an App ID" button.

----------------------------
API Information

Product Search API v3
  http://developer.yahoo.com/shopping/V3/productSearch.html

Yahoo Java developer site
  http://developer.yahoo.com/java/

Yahoo! Shopping Developer Support Group
  http://tech.groups.yahoo.com/group/yws-shopping/

 
----------------------------
Compilation:

  > javac *.java

----------------------------
Execution:

  > UseProxy SearchYahoo <book title>
e.g.

  > UseProxy SearchYahoo "killer game programming in java"


It will download a book cover, and create a XML file called temp.xml

---------
Last updated: 1st July 2009
